import { useState, useEffect } from 'react'
import './App.css'
import Com from './Com/Com'
function App() {
  const [data, setData] = useState([])

  const getDataFn = async () => {
    const qq = await fetch('https://systemjs.1688.com/krump/schema/1352.json')
      .then((response) => response.json())
      .then((res) => {
        return res?.list
      })

    setData(qq)
    return qq
  }
  useEffect(() => {
    getDataFn()
  }, [])
  return (
    <>
      <h2>1688进货红包</h2>
      {data.map((item) => {
        return <Com data={item} />
      })}
    </>
  )
}

export default App
